package com.yanqu.road.server.cmd.activity.seacraftsouthsea;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.SeacraftSouthSeaProto;
import com.yanqu.road.pb.union.UnionProto;
import com.yanqu.road.server.cmd.CrossUnionCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.activity.seacraftsouthsea.SeacraftSouthSeaMgr;
import com.yanqu.road.server.protocol.CrossProtocol;

/**
 * @Description
 * @Author cwq
 * @Data 2022/1/20 17:21
 */
@Cmd(code = CrossProtocol.C2_SEACRAFT_SOUTH_SEA_SYN_UNION_MEMBER_CHANGE, desc = "海上争霸 南海丝路 同步联盟成员")
public class CrossSeacraftSouthSeaSynUnionMemberChangeCmd extends CrossUnionCommand {

    long userId;
    int activityId;
    int type;
    String unionId;
    UnionProto.UnionBaseTempMsg unionBaseTempMsg;
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        SeacraftSouthSeaProto.SeacraftSouthSeaSynUnionMemberGameToCrossMsg reqMsg = SeacraftSouthSeaProto.SeacraftSouthSeaSynUnionMemberGameToCrossMsg.parseFrom(packet.getBytes());
        activityId = reqMsg.getActivityId();
        userId = reqMsg.getUserId();
        type = reqMsg.getType();
        unionId = reqMsg.getUnionId();
        unionBaseTempMsg = reqMsg.getUnionInfo();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        SeacraftSouthSeaMgr.changeUnion(type, activityId,userId,unionId,unionBaseTempMsg);

    }

    @Override
    public void sendData() {

    }
}
